package com.mars.foodserver.controller.app;

import com.mars.foodserver.controller.common.BaseController;
import com.mars.foodserver.response.FoodLikeResponse;
import com.mars.foodserver.response.result.R;
import com.mars.foodserver.service.IFoodLikeService;
import com.mars.foodserver.service.INotesLikeService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wq
 * @since 2021-07-21
 */
@RestController
@RequestMapping("/notes")
@AllArgsConstructor
public class NotesLikeController extends BaseController {

    final INotesLikeService notesLikeService;

    /**
     * 点赞
     *
     * @param noteId 笔记ID
     * @param type   1 点赞 2 取消点赞
     */
    @GetMapping("/like")
    public R<Void> like(Integer noteId, Integer type) {
        notesLikeService.like(getUserId(), noteId, type);
        return R.success();
    }


}
